package com.wedo.mall.dialog;

import android.content.Context;

import com.e.library.dialog.EDialog;
import com.wedo.mall.R;

import butterknife.OnClick;

/**
 * @author lxy
 * @time 2017/8/4  15:33
 */
public class ConsultDialog extends EDialog {

    public static final int CONSULT_PHONE = 0;
    public static final int CONSULT_CHAT = 1;
    public OnConsultListener listener;

    public static ConsultDialog with(Context context){
        return new ConsultDialog(context);
    }

    public ConsultDialog(Context context) {
        super(context);
    }

    @Override
    protected int layout() {
        return R.layout.dialog_consult;
    }

    @Override
    protected void onDialogCreated(Context context) {
    }

    @OnClick(R.id.tv_consult_phone)
    protected void onConsultPhoneClick(){
        if(listener !=null) {
            listener.onConsult(CONSULT_PHONE);
        }
        dismiss();
    }

    @OnClick(R.id.tv_consult_chat)
    protected void onConsultChatClick(){
        if(listener !=null) {
            listener.onConsult(CONSULT_CHAT);
        }
        dismiss();
    }

    @OnClick(R.id.ll_root)
    protected void onRootClick(){
        dismiss();
    }

    public interface OnConsultListener{
        void onConsult(int type);
    }
}
